- /* ipow10.cpp by K.Tsuru */
- /**************************************
- It returns 10^n.
- It does not check 10^n < LONG_MAX.
- ***************************************/
- #include <stdlib.h>
- #include <stdio.h>
- #include <limits.h>
- #include <cmath>
-
- #include "mathtp.h"
-
- long ipow10(int n){
- if(n<0) return 0;
-
- double r = dpow10(n);
- if(r > (double)LONG_MAX) {
- perror("ipow10(n) is too large.");
- exit(1);
- }
- return (long)r;
- }
ipow10.cpp : last modifiled at 2017/02/16 22:22:30(447 bytes)
created at 2016/04/11 11:17:20
The creation time of this html file is 2017/10/07 10:54:15 (Sat Oct 07 10:54:15 2017).